﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Tencent.OA.ACM.Entity.FocusCondition>" %>

<%@ Import Namespace="Tencent.OA.ACM.Entity" %>
<%@ Import Namespace="Tencent.OA.ACM.App" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeaderPlaceHolder" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="mainContainerPlaceHolder" runat="server">
    <%--  <ul id="tags" class="tags">
        <li><a href="<%=this.Url.Content("~/Report/SingleRoute") %>">单条路线</a></li>
        <li class="selectTag"><a href='javascript:void(0)'>所有路线</a></li>
        <span class="bt">统计报表 -- 所有路线</span>
    </ul>
    <div class="tagCon">
        <div id="tagContent2" class="tagContent ">
        </div>
    </div>--%>
    <div class="title ">
        关注站点(路线)
    </div>
    <%
        string display = "none";
        if (ViewData["hasCondition"] != null && ViewData["hasCondition"].ToString().Length > 0)
            display = "";
    
    %>
    <!--查询条件 Start-->
    <div id="condition" style="display: <%=display%>;">
        <%
            using (Html.BeginForm("Index", "Focus", FormMethod.Get))
            {          
       
        %>
        <table cellpadding="0" cellspacing="0">
            <tr>
                <th>
                    路线名：
                </th>
                <td>
                    <%=Html.TextBoxFor(o=>o.RouteName) %>
                </td>
                <th>
                    站点名称：
                </th>
                <td>
                    <%=Html.TextBoxFor(o=>o.StationName) %>
                </td>
                <th>
                    &nbsp;
                </th>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <th>
                </th>
                <td>
                    <input type="submit" class="form_bot" name="submit" value="查 询" 
                        style="width: 100px;" />
                </td>
                <td colspan="4">
                </td>
            </tr>
        </table>
            <%=this.Html.Hidden("condition_hidden",
                (ViewData["conditon"] == null) ? "" : ViewData["conditon"]
                           ) %>
        <%} %>
    </div>
    <!--查询条件 end-->
    <!--列表查询two-->
    <div class="list_title">
        <div class="pag_right">
        </div>
        <div style="padding-top: 6px;">
            <input type="button" value="查询" class="form_bot" id="btn_query" onclick='$("#condition").show();' />            
           <%-- <input type="button" value="删除" class="form_bot" />--%>
        </div>
    </div>
    <table id="myFault" class="tblData" cellpadding="0" cellspacing="0" style="width: 100%">
        <thead>
            <tr class="lt_head">
                <th style="width:60px;">
                    序 号
                </th>
                <th>
                   路 线 名
                </th>
                <th>
                     站 点
                </th>
                <th style="width:120px;">
                     创建日期
                </th>
                <th style="width:80px;">
                    操 作
                </th>
            </tr>
        </thead>
        <tbody id="gvList">
            <%
                IList<Tencent.OA.ACM.Entity.FocusItem> list = this.Model.DataList.PagedList;                
            %>
            <%=this.Html.ListTableNoResultMessage(list, 5)%>
            <%           
                foreach (FocusItem m in list)
                {
            %>
            <tr>
                <td> <%=m.RN %> </td>
                <td> <a href="<%=this.Url.Content("~/home/RouteView?rid="+m.RouteID) %>">
                    <%=m.RouteName %></a> </td>
                <td><a href="<%=this.Url.Content("~/home/RouteView?rid="+m.RouteID+"&sid="+m.StationID) %>"><%=m.StationName %></a></td>
                <td><%=m.CteateTime.ToString("yyyy-MM-dd") %> </td>
                <td>
                <a href="javascript:;" onclick="Del('<%=m.FocusId %>');" >删除</a> 
                </td>
            </tr>
            <%
                }
            %>
        </tbody>
    </table>
    <!--翻页 Start-->
    <div class="paging">
        <%=Html.Pager<FocusItem>(this.Model.DataList)%>
    </div>
    <!--翻页 End-->
    <script language="javascript" type="text/javascript">
    displayLoading = true;
        function Del(id) {
            if (!confirm("是否确定删除该站点？"))
            { return; }
             //提交
             $.ajax({ 
                type: "GET",
                url: "<%=this.Url.Content("~/Focus/DelFocusItem") %>", 
                data: {"id":id},
                success: function(msg){
                        if(msg.StatuCode==-1){                        
                             InfoTip.showMessage("删除失败！" , 1); 
                             return ;
                        }   
                        else{
                             window.location.reload();
                        }                  
                    }
                });
        }    
    </script>
</asp:Content>
